﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package org.aswing {
    import flash.display.*;
    import org.aswing.plaf.basic.*;

    public class JLabel extends Component {

        public static const CENTER:int = 0;
        public static const TOP:int = 1;
        public static const LEFT:int = 2;
        public static const BOTTOM:int = 3;
        public static const RIGHT:int = 4;
        public static const HORIZONTAL:int = 0;
        public static const VERTICAL:int = 1;

        private var icon:Icon;
        private var text:String;
        private var disabledIcon:Icon;
        private var verticalAlignment:int;
        private var horizontalAlignment:int;
        private var verticalTextPosition:int;
        private var horizontalTextPosition:int;
        private var iconTextGap:int;
        private var selectable:Boolean;
        private var textFilters:Array = null;

        public function JLabel(_arg1:String="", _arg2:Icon=null, _arg3:int=0){
            setName("JLabel");
            this.verticalAlignment = CENTER;
            this.verticalTextPosition = CENTER;
            this.horizontalTextPosition = RIGHT;
            this.text = _arg1;
            this.icon = _arg2;
            this.installIcon(_arg2);
            this.horizontalAlignment = _arg3;
            this.iconTextGap = 4;
            this.selectable = false;
            this.updateUI();
        }
        override public function updateUI():void{
            setUI(UIManager.getUI(this));
        }
        override public function getDefaultBasicUIClass():Class{
            return (BasicLabelUI);
        }
        override public function getUIClassID():String{
            return ("LabelUI");
        }
        protected function installIcon(_arg1:Icon):void{
            if (((!((_arg1 == null))) && (!((_arg1.getDisplay(this) == null))))){
                addChild(_arg1.getDisplay(this));
            };
        }
        protected function uninstallIcon(_arg1:Icon):void{
            var _local2:DisplayObject = ((_arg1 == null)) ? null : _arg1.getDisplay(this);
            if (((!((_local2 == null))) && (isChild(_local2)))){
                removeChild(_arg1.getDisplay(this));
            };
        }
        public function setText(_arg1:String):void{
            if (this.text != _arg1){
                this.text = _arg1;
                repaint();
                invalidate();
            };
        }
        public function getText():String{
            return (this.text);
        }
        public function setSelectable(_arg1:Boolean):void{
            this.selectable = _arg1;
        }
        public function isSelectable():Boolean{
            return (this.selectable);
        }
        public function setTextFilters(_arg1:Array):void{
            this.textFilters = _arg1;
            repaint();
        }
        public function getTextFilters():Array{
            return (this.textFilters);
        }
        public function setIcon(_arg1:Icon):void{
            if (this.icon != _arg1){
                this.uninstallIcon(this.icon);
                this.icon = _arg1;
                this.installIcon(this.icon);
                repaint();
                invalidate();
            };
        }
        public function getIcon():Icon{
            return (this.icon);
        }
        public function getDisabledIcon():Icon{
            if (this.disabledIcon == null){
                if (this.icon != null){
                };
            };
            return (this.disabledIcon);
        }
        public function setDisabledIcon(_arg1:Icon):void{
            var _local2:Icon = this.disabledIcon;
            this.disabledIcon = _arg1;
            if (_arg1 != _local2){
                this.uninstallIcon(_local2);
                this.installIcon(_arg1);
                if (!isEnabled()){
                    repaint();
                    invalidate();
                };
            };
        }
        public function getVerticalAlignment():Number{
            return (this.verticalAlignment);
        }
        public function setVerticalAlignment(_arg1:Number):void{
            if (_arg1 == this.verticalAlignment){
                return;
            };
            this.verticalAlignment = _arg1;
            repaint();
        }
        public function getHorizontalAlignment():Number{
            return (this.horizontalAlignment);
        }
        public function setHorizontalAlignment(_arg1:Number):void{
            if (_arg1 == this.horizontalAlignment){
                return;
            };
            this.horizontalAlignment = _arg1;
            repaint();
        }
        public function getVerticalTextPosition():Number{
            return (this.verticalTextPosition);
        }
        public function setVerticalTextPosition(_arg1:Number):void{
            if (_arg1 == this.verticalTextPosition){
                return;
            };
            this.verticalTextPosition = _arg1;
            repaint();
            revalidate();
        }
        public function getHorizontalTextPosition():Number{
            return (this.horizontalTextPosition);
        }
        public function setHorizontalTextPosition(_arg1:Number):void{
            if (_arg1 == this.horizontalTextPosition){
                return;
            };
            this.horizontalTextPosition = _arg1;
            repaint();
            revalidate();
        }
        public function getIconTextGap():Number{
            return (this.iconTextGap);
        }
        public function setIconTextGap(_arg1:Number):void{
            var _local2:Number = this.iconTextGap;
            this.iconTextGap = _arg1;
            if (_arg1 != _local2){
                revalidate();
                repaint();
            };
        }

    }
}//package org.aswing 
